package springbootspike.service;

/**
 * Created by sidney on 2019/04/09
 */

import springbootspike.error.BusinessException;
import springbootspike.service.model.ItemModel;

import java.util.List;


public interface ItemService {

    //创建商品
    ItemModel createItem(ItemModel itemModel) throws BusinessException;

    //商品列表浏览
    List<ItemModel> listItem();

    //商品详情浏览
    ItemModel getItemById(Integer id) throws BusinessException;

    //库存扣减
    boolean decreaseStock(Integer itemId, Integer amount ) throws BusinessException;

    //商品销量增加
    void increaseSales(Integer itemId, Integer amount ) throws BusinessException;
}